package jmine.tec.rpc.integration.api.rs;

import java.util.ArrayList;
import java.util.List;

import jmine.tec.rpc.common.annotation.Lazy;
import jmine.tec.rpc.common.entity.AbstractEntityRepresentation;

/**
 * @author lundberg
 */
public class MockEntityRS extends AbstractEntityRepresentation {

    private String value;

    private List<AssociatedMockEntityRS> references = new ArrayList<AssociatedMockEntityRS>();

    /**
     * @return the value
     */
    public String getValue() {
        return this.value;
    }

    /**
     * @param value the value to set
     */
    public void setValue(String value) {
        this.value = value;
    }

    /**
     * @return the references
     */
    @Lazy
    public List<AssociatedMockEntityRS> getReferences() {
        return this.references;
    }

    /**
     * @param references the references to set
     */
    public void setReferences(List<AssociatedMockEntityRS> references) {
        this.references = references;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        return this.value.hashCode();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (this.getClass() != obj.getClass()) {
            return false;
        }
        MockEntityRS other = (MockEntityRS) obj;
        if (this.value == null) {
            if (other.value != null) {
                return false;
            }
        } else if (!this.value.equals(other.value)) {
            return false;
        }
        return true;
    }
}